#include "plank.h"
#include <QMouseEvent>

Plank::Plank(double x,double y,QLabel * _pla)
{
    this->px=x;
    this->py=y;
    this->pla = _pla;
    pla->setGeometry(px,py,300,300);
}

void Plank::setPlaStyle(int n)
{
    //pla->setText("///////////@@@@@@@@@@//////////");
    switch(n)
    {
    case 1:
    {
        QPixmap px = QPixmap(":/ic/bar");
        pla->setPixmap(px);
        break;
    }
    case 2:
    {
        QPixmap px = QPixmap(":/ic/bar2");
        pla->setPixmap(px);
        break;

    }
    case 3:
    {
        QPixmap px = QPixmap(":/ic/bar3");
        pla->setPixmap(px);
        break;

    }
    case 4:
    {
        QPixmap px = QPixmap(":/ic/bar4");
        pla->setPixmap(px);
        break;

    }
    case 5:
    {
        QPixmap px = QPixmap(":/ic/bar5");
        pla->setPixmap(px);
        break;

    }
    default:
        break;
    }
}

void Plank::setPlaLength(int n)
{
    plength = n;
    this->pla->setGeometry(px,py,plength,plength);
}

int Plank::getLength()
{
    return this->plength;
}

int Plank::getX()
{
    return this->pla->geometry().x();
}
